<UserControl x:Class="MyCompany.Views.MyApplicationView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:UserInterfaceLibrary="clr-namespace:MyCompany.UserInterfaceLibrary;assembly=MyCompany.UserInterfaceLibrary"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:viewModels="clr-namespace:MyCompany.ViewModels;assembly=MyCompany.ViewModels"
             Background="LightGray"
             d:DataContext="{d:DesignInstance viewModels:MyApplicationViewModel}"
             d:DesignWidth="300"
             mc:Ignorable="d">
    <UserControl.Resources>
        <ResourceDictionary Source="/MyCompany.UserInterfaceLibrary;component/MergedDictionaries.xaml" />
    </UserControl.Resources>
    <Grid x:Name="grid">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="100" />
            <RowDefinition Height="0" />
            <RowDefinition Height="0" />
        </Grid.RowDefinitions>
        <WrapPanel Margin="3" Orientation="Horizontal">
            <UserInterfaceLibrary:NarrowButton VerticalAlignment="Center" Padding="5">
                Toggle Log Viewer
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <ei:CallMethodAction MethodName="_ToggleLogViewer" TargetObject="{Binding}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </UserInterfaceLibrary:NarrowButton>
            <UserInterfaceLibrary:NarrowButton VerticalAlignment="Center" Padding="5">
                Show Message Box
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <ei:CallMethodAction MethodName="_ShowMessageBoxRequested" TargetObject="{Binding}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </UserInterfaceLibrary:NarrowButton>
            <UserInterfaceLibrary:NarrowButton VerticalAlignment="Center" Padding="5">
                Show Log Dialog
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <ei:CallMethodAction MethodName="_ShowLogDialogRequested" TargetObject="{Binding}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </UserInterfaceLibrary:NarrowButton>
            <UserInterfaceLibrary:NarrowButton VerticalAlignment="Center" Padding="5">
                Force handled exception to be thrown
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <ei:CallMethodAction MethodName="_ForceHandledException" TargetObject="{Binding}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </UserInterfaceLibrary:NarrowButton>
            <UserInterfaceLibrary:NarrowButton VerticalAlignment="Center" Padding="5">
                Force unhandled exception to be thrown
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <ei:CallMethodAction MethodName="_ForceUnhandledException" TargetObject="{Binding}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </UserInterfaceLibrary:NarrowButton>
            <UserInterfaceLibrary:NarrowButton VerticalAlignment="Center" Padding="5">
                Show Wait Cursor Technique
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <ei:CallMethodAction MethodName="_ShowWaitCursor" TargetObject="{Binding}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </UserInterfaceLibrary:NarrowButton>
            <UserInterfaceLibrary:NarrowButton VerticalAlignment="Center" Padding="5">
                Request Application Exit
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <ei:CallMethodAction MethodName="_RequestApplicationExit" TargetObject="{Binding}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </UserInterfaceLibrary:NarrowButton>
            <UserInterfaceLibrary:NarrowButton VerticalAlignment="Center" Padding="5">
                Request Application Exit With Simulated Cleanup Exception
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <ei:CallMethodAction MethodName="_RequestApplicationExitWithSimulatedCleanupException" TargetObject="{Binding}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </UserInterfaceLibrary:NarrowButton>
            <UserInterfaceLibrary:NarrowButton VerticalAlignment="Center" Padding="5">
                Show About Box
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <ei:CallMethodAction MethodName="_AboutBox" TargetObject="{Binding}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </UserInterfaceLibrary:NarrowButton>
        </WrapPanel>
        <TabControl Grid.Row="1"
                    Grid.ColumnSpan="2"
                    Margin="10,10,10,0"
                    ItemContainerStyle="{StaticResource TabItemDeluxeStyle}"
                    Style="{StaticResource TabControlDeluxeStyle}">
            <TabControl.Effect>
                <DropShadowEffect ShadowDepth="2" />
            </TabControl.Effect>
            <TabItem Header="Tab1">
                <Border Background="{StaticResource BrushDarkGrey}"
                        BorderBrush="Transparent"
                        BorderThickness="0" />
            </TabItem>
            <TabItem Header="Tab2" />
        </TabControl>
        <GridSplitter Grid.Row="2"
                      Grid.ColumnSpan="2"
                      Margin="3,0,3,3"
                      HorizontalAlignment="Stretch"
                      Background="#20FFFFFF"
                      Visibility="{Binding _IsLogViewerVisible,
                                           Converter={StaticResource VisibilityConverter},
                                           ConverterParameter=TrueToVisibleAndFalseToHidden}">
            <GridSplitter.Effect>
                <DropShadowEffect ShadowDepth="2" />
            </GridSplitter.Effect>
        </GridSplitter>
        <TextBox x:Name="textBoxLogViewer"
                 Grid.Row="3"
                 MinHeight="100"
                 Margin="5"
                 HorizontalScrollBarVisibility="Auto"
                 IsReadOnly="True"
                 IsReadOnlyCaretVisible="True"
                 Text="{Binding _OutputText}"
                 VerticalScrollBarVisibility="Auto" />
    </Grid>
</UserControl>